package com.mercury.ec.module.air.enums;

import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.ObjUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 机票pnr单状态枚举
 *
 * @author hesx
 */
@Getter
@AllArgsConstructor
public enum AirPnrStatusEnum {

    HK("HK", "预订"),
    RR("RR", "出票"),
    XX("XX", "取消"),
    ;


    public static final String DICT_TYPE = "";

    /**
     * 值
     */
    private final String status;
    /**
     * 名称
     */
    private final String name;

    public static AirPnrStatusEnum getByStatus(int status) {
        return ArrayUtil.firstMatch(o -> o.getStatus().equals(status), values());
    }

    public static boolean isHk(Integer status) {
        return ObjUtil.equal(HK.status, status);
    }

    public static boolean isRr(Integer status) {
        return ObjUtil.equal(RR.status, status);
    }

    public static boolean isXx(Integer status) {
        return ObjUtil.equal(XX.status, status);
    }

}
